package com.yexs.beans;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @Description: 资源配置bean
 * @Author: yexs
 * @CreateDate: 2018/5/29 8:53
 * @Version: 1.0
 */
@Component
//@PropertySource(value = "classpath:test.properties") 自定义资源文件位置
//或者
//@ConfigurationProperties(ignoreUnknownFields = false,locations = "classpath:properyname.properties", prefix = "datasource")
@ConfigurationProperties(prefix = "myinfo")//prefix不能大写（资源文件中可以）
public class MyInfo {
    private String name;
    private int age;
    private int number;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }
}
